<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="../templates/default3.xhtml">
            <ui:define name="content">
                <h:form id="addRole" binding="#{controlManagerBean.loadAddControl}">

                    <p:panel id="controlInfo" header ="Control Information">
                        <font class="fieldNote">* - Mandatory Field<br/><br/></font>
                        <p:messages/>
                        <table class="panel">
                            <tr>
                                <td>
                                    Page title
                                    <br></br>
                                    <p:inputText required="true" id="title" requiredMessage="Page Title Required" value="#{controlManagerBean.title}"> 

                                    </p:inputText> 
                                    <font class="fieldNote">*</font>
                                </td>      
                            </tr>
                            <tr>
                                <td>
                                    Department
                                    <br></br>
                                    <h:selectOneMenu id="department" value="#{controlManagerBean.department}">
                                        <f:selectItem id="Wholesales" itemLabel="Sales - Wholesales" itemValue="Sales - Wholesales" />
                                        <f:selectItem id="Directsales" itemLabel="Sales - Direct sales" itemValue="Sales - Direct sales" />
                                        <f:selectItem id="Mktcampaign" itemLabel="Marketing - Marketing campaign" itemValue="Marketing - Marketing campaign" />
                                        <f:selectItem id="MktMM" itemLabel="Marketing - Mass media advertising" itemValue="Marketing - Mass media advertising" />
                                        <f:selectItem id="MktNM" itemLabel="Marketing - New and social media adverting" itemValue="Marketing - New and social media adverting" />
                                        <f:selectItem id="Prodsp" itemLabel="Production and Operation - sales planning" itemValue="Production and Operation - sales planning" />
                                        <f:selectItem id="Prodpp" itemLabel="Production and Operation - production planning" itemValue="Production and Operation - production planning" />
                                        <f:selectItem id="Proff" itemLabel="Production and Operation - factory floor" itemValue="Production and Operation - factory floor" />                                       
                                        <f:selectItem id="scw" itemLabel="Supply chain - Warehouse" itemValue="Supply chain - Warehouse" />
                                        <f:selectItem id="scship" itemLabel="Supply chain - Shipping" itemValue="Supply chain - Shipping" />
                                        <f:selectItem id="scpurch" itemLabel="Supply chain - Purchasing" itemValue="Supply chain - Purchasing" />
                                        <f:selectItem id="finar" itemLabel="Finance - Accounts receivable" itemValue="Fiance - Accounts receivable" />                                        
                                        <f:selectItem id="finap" itemLabel="Finance - Accounts payable" itemValue="Finance - Accounts payable" />                                       
                                        <f:selectItem id="finia" itemLabel="Finance - Internal audit" itemValue="Finance - Internal audit" />                                        
                                        <f:selectItem id="techtc" itemLabel="Technology - Technical support" itemValue="Technology - Technical support" />             
                                        <f:selectItem id="techad" itemLabel="Technology - Application Development" itemValue="Technology - Application Development" />
                                    </h:selectOneMenu>
                                </td>      
                            </tr>
                            <tr>
                                <td>
                                    Header
                                    <br></br>
                                    <p:autoComplete required ="true" requiredMessage ="Header Required" id="header" value="#{controlManagerBean.header}" completeMethod="#{controlManagerBean.complete}">  

                                    </p:autoComplete> 
                                    <font class="fieldNote">*</font>

                                </td>                                       
                            </tr>            
                            <tr>
                                <td>
                                    File name 
                                    <br></br>
                                    <p:inputText required ="true" requiredMessage ="File Name Required" id="page" value="#{controlManagerBean.pageAddress}"> 

                                    </p:inputText>
                                    <font class="fieldNote">*</font>
                                    <font class="fieldNote"> E.g: index.xhtml </font>

                                </td>      
                            </tr>
                            <tr>
                                <td>
                                    Related page(s)
                                    <br></br>
                                    <p:inputTextarea  id="relatedPage" style="width:300px;height:50px;" effectDuration="400" value="#{controlManagerBean.relatedPage}">

                                    </p:inputTextarea>
                                </td>                                       
                            </tr>
                            <tr>
                                <td>
                                    <font class="fieldNote"> E.g. index.xhtml; login.xhtml</font>
                                </td>
                            </tr>
                            <tr> 
                                <td>
                                    Control description
                                    <table>
                                        <tr>
                                            <td>
                                                <p:inputTextarea required="true" id="description" requiredMessage="Control Description Required" style="width:300px;height:100px;" effectDuration="400" value="#{roleManagerBean.description}">    
                                                </p:inputTextarea>
                                            </td>
                                            <td>    <font class="fieldNote">*</font>
                                            </td>
                                        </tr>
                                    </table></td>




                            </tr>
                            <tr>
                                <td class="btn">
                                    <hr/>                    
                                    <p:commandButton id="btnAdd" value="Add" actionListener="#{controlManagerBean.addNewControl}" update="addRole" ajax="true" />
                                </td></tr>
                        </table>
                    </p:panel>
                </h:form>
            </ui:define>        
        </ui:composition>
    </body>
</html>
